<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="catalog" tagdir="/WEB-INF/tags/catalog"%>
<%@ taglib prefix="sales" tagdir="/WEB-INF/tags/sales"%>
<%@ taglib prefix="customer" tagdir="/WEB-INF/tags/customer"%>
<%@ taglib prefix="probiz" tagdir="/WEB-INF/tags/probiz"%>
<%@ taglib prefix="content" tagdir="/WEB-INF/tags/content"%>

<html>
	<head>
		<script type="text/javascript"	src="${ctxPath}/scripts/probiz/product/productDetail.js?rs=${appConfig.rs}"></script>
	</head>
	<title>${empty	product.title?product.productName:product.title}</title>
	<meta name="keywords" content="${not empty product.metaKeyword?product.metaKeyword:product.keywords}" />
	<meta name="description" content="${not empty product.metaDescription?product.metaDescription:product.productDescription.shortDescription}" />
	<body>
		<%---------------------------------start:当前位置 -------------------------%>
		<div class="position"><fmt:message key="position.your"/>
			<catalog:productCategoryNavigation categoryId="${category.categoryId}" isNeedLastCategoryUrl="true"/>
		</div>
		<%---------------------------------end:  当前位置 -------------------------%>
		<div class="line10"></div>
		<div class="detail clearfix">
			<div class="gallery">
				<%---------------------------------start:商品图片区 -------------------------%>
				<%@ include file="include/productDetailImageArea.jspf"%>
				<%---------------------------------end:  商品图片区 -------------------------%>
				
				<div class="action">
					<script type="text/javascript">
						bookmark_service_div="qqxy,kxzt,douban,baidu,qq,msn,163weibo,more";
						bookmark_service="sinaweibo,qqweibo,qqkj,xnzt,more";
					</script>
					<div class="passit_def_div"><a class="passit_default" href="http://www.passit.cn/bookmark.html" target="_blank"><fmt:message key="product.share"/></a></div>
					<script type="text/javascript">
						var passit_title = "";//自定义分享标题，删除和留空表示使用默认
						var passit_url = "";//自定义分享网址，删除和留空表示使用默认
						var passit_content= "";//自定义分享内容，删除和留空表示使用默认
					</script>
					<a href="javascript:void(0);" onclick="doRequiredLoginAction(addFavoriteProduct(${product.productId}));"><fmt:message key="product.addFavorite"/></a>
					|&nbsp;<a id="tellFirendAction" href="javascript:void(0)" onclick="toggleTellFriendDialog(this)" class="arr_down"><fmt:message key="productDetail.tellFriends"/></a>  
					
				</div>
				<%---------------------------------start:告诉朋友 -------------------------%>
				<%@ include file="include/productDetailTellFriendDialog.jspf"%>
				<%---------------------------------end:  告诉朋友 -------------------------%>
			</div>
			
			<div class="property">
				<%---------------------------------start:概要区 -------------------------%>
				<%@ include file="include/productDetailSummary.jspf"%>
				<%---------------------------------end:  概要区 -------------------------%>
				
				<%---------------------------------start:商品包包含商品区 -------------------------%>
				<%@ include file="include/productDetailPackageItems.jspf"%>
				<%---------------------------------end:  商品包包含商品区 -------------------------%>
				
				<%---------------------------------start:配件区 -------------------------%>
				<sales:recommendedProductList recommendedTypeName="accessories" sourceKind="0" maxResults="-1" sourceIds="${product.productId}" 
								returnProductListName="accessoryProductList" returnRecommendedTypeName="accessoryType">
					<%@ include file="include/productDetailAccessory.jspf"%>
				</sales:recommendedProductList>				
				<%---------------------------------end:  配件区 -------------------------%>
				
				<%---------------------------------start:赠送礼品 -------------------------%>
				<sales:productPromotionGiftList productSku="${product.defaultProductSku}" returnGiftList="giftList">				
					<%@ include file="include/productSkuPromotionGiftList.jspf"%>
				</sales:productPromotionGiftList>
				<%---------------------------------end:  赠送礼品 -------------------------%>
				
				<%---------------------------------start:销售，价格选项区 -------------------------%>
				<%@ include file="include/productDetailSales.jspf"%>
				<%---------------------------------end:  销售，价格选项区 -------------------------%>
				<ul class="others clearfix">
					<li>
						<fmt:formatNumber var="score" value="${product.productStat.reviewScore}" pattern="0.0"/>
						<customer:scoreStar value="${score}"/>
						<span>
							<a href="<customer:productReviewUrl product="${product}"/>" target="_blank">
								<fmt:message key="productDetail.onshowReviewCount.title">
									<fmt:param>${product.productStat.onShowReviewCount}</fmt:param>
								</fmt:message>
							</a>
						</span>
					</li>
					<li class="r">
						<a href="<customer:stockNotifyUrl product="${product}"/>?doAction=sign" ><fmt:message key="product.stockNotify.sign"/></a> 
					</li>
				</ul>
			</div>
			
		</div>
		<div class="line10"></div>
		
		
		<div class="clearfix">
			<div class="main_left_content">
				<%---------------------------------start:与商品相关的促销信息 -------------------------%>
				<sales:productPromotionRuleList product="${product}" returnPRuleListName="pruleList">
					<%@ include file="include/productDetailPromotionInfo.jspf"%>
				</sales:productPromotionRuleList>
				<%---------------------------------end:  与商品相关的促销信息 -------------------------%>
				
				<%---------------------------------start:关联到的商品包开始 -------------------------%>
				<product:relatedProductPackageList product="${product}" returnProductPackageListName="productPackageList">
					<%@ include file="include/productDetailRelatedPackage.jspf"%>
				</product:relatedProductPackageList>
				<%---------------------------------end:  关联到的商品包开始 -------------------------%>
				
				<div class="wrap_04">
					<%@ include file="include/productDetailTabHeader.jspf"%>
					<%-- ===================== 详细描述开始  =====================--%>
					<%@ include file="include/productDetailFullDescription.jspf"%>
					<%-- ===================== 详细描述结束  =====================--%>
					
					<%-- ===================== 商品属性开始  =====================--%>
					<%@ include file="include/productDetailAttr.jspf"%>
					<%-- ===================== 商品属性结束  =====================--%>

					<%-- ===================== 商品评论开始  =====================--%>
					<%@ include file="include/productDetailReview.jspf"%>
					<%-- ===================== 商品评论结束  =====================--%>

					<%-- ===================== 购买咨询开始  =====================--%>
					<%@ include file="include/productDetailConsult.jspf"%>
					<%-- ===================== 购买咨询结束  =====================--%>
					
					<%-- ===================== 附件下载开始  =====================--%>
					<%@ include file="include/productDetailAttachment.jspf"%>
					<%-- ===================== 附件下载结束  =====================--%>
	
				</div>
				
				<%---------------------------------start:AlsoBuy区域 -------------------------%>
				<sales:recommendedProductList recommendedTypeName="also_buy" sourceKind="0" maxResults="10" sourceIds="${product.productId}" 
								returnProductListName="alsoBuyProductList" returnRecommendedTypeName="alsoBuyType">
					<%@ include file="../sales/recommendedProduct/display/productDetailAlsoBuy.jspf"%>
				</sales:recommendedProductList>		
				<%---------------------------------end:  AlsoBuy区域 -------------------------%>
				
			</div>
		</div>
		
		<%---------------------------------start:用于浏览历史 -------------------------%>
		<input type="hidden" id="_imgSrc" value="<product:imageSrc url="${mediaPath}${(not empty product.imageUrl)?product.imageUrl:''}" sizeType="s0"/>">
		<input type="hidden" id="_productId" value="${product.productId}">
		<input type="hidden" id="_title" value="${product.productName}">
		<input type="hidden" id="_price" value="${product.defaultProductSku.viewPrices[1]}">
		<%---------------------------------start:用于浏览历史 -------------------------%>
		
		<c:set var="probizJs_loginDlg" value="true" scope="request"/>
		<c:set var="probizJs_validation" value="true" scope="request"/>	
		<c:set var="plugin_zoom" value="true" scope="request"/>
		<c:set var="plugin_clipboard" value="true" scope="request"/>
		<c:set var="plugin_jcarousel_js" value="true" scope="request"/>
		<c:set var="plugin_jcarousel_css_style1" value="true" scope="request"/>
		<c:set var="plugin_jcarousel_css_style2" value="true" scope="request"/>
		<c:set var="probizJs_productReview" value="true" scope="request"/>
		<c:set var="probizJs_consult" value="true" scope="request"/>
		<c:set var="probizJs_productDetail" value="true" scope="request"/>
		
		
		<script type="text/javascript">
			$j(document).ready(function () {
			
				<%---------------------------------start:这部分在销售价格之前运行 -------------------------%>
				//start:设置基本变量
				jsonProduct = eval(${jsonProduct});
				jsonSkus = jsonProduct.productSkus;
				optionSize = ${fn:length(mapOfRelatedSkuOptionAndValues)};
				<c:if test="${product.isSetMultiSkus == 0}">
					//如果是无规格，则只需取默认。
					currProductSku = jsonSkus[0];
				</c:if>
				basicImageSrc = "${product.imageUrl}";
				//end:设置基本变量
				<%---------------------------------start:这部分在销售价格之前运行 -------------------------%>
				
				<%---------------------------------start:绑定规格值js   -------------------------%>
				$j('#skuOptionArea li[id^="skuOptionValue"]').bind('click',toggleSkuOptionValue);
				$j('div.key_loading').hide();
				$j('div[group="skuOption"]').show();
				<%---------------------------------end:  绑定规格值js   -------------------------%>
				
				//start:tab效果
				$j('#detailTabUL li').each(function(i,o){
					$j(o).bind("click",function(){
						$j('#detailTabUL li').each(function(i,o){
							$j(this).find('a').removeClass("curr");
							$j('#detailTab'+this.id).hide();
						});
						$j(this).find('a').addClass("curr");
						$j('#detailTab'+this.id).show();
						
					});
				
				});
				//end:tab效果
				
				//start:关联商品包滚动条效果
				 $j('div[name="relatedPackageScroll"]').jcarousel({
			        scroll: 2
			    });
				//end:关联商品包滚动条效果
				
				//start:商品图片滚动条效果
			    $j('#productImageScroll').show();
				$j('#productImageScroll').jcarousel({
			        vertical: true,
			        scroll:2
			    });
				//start:商品图片滚动条效果
				
				//start:放大镜效果
				<c:if test="${not empty product.imageUrl}">
					$j('#bigImageLink').jqzoom({
						 zoomWidth: 300,
				         zoomHeight: 300,
				         xOffset: 133,
				         title:false,
				         preloadText:__FMT.productDetail_imageLoading
					});
				</c:if>
				//end:放大镜效果
				<%---------------------------------start:绑定查看中图js -------------------------%>
				<c:forEach	items="${product.productImages}" var="media" varStatus="mediaStatus">
					$j('#productImage${mediaStatus.index}').bind('click',{"imageSrc":"${mediaPath}${media.mediaUrl}"},viewMiddleImage);
				</c:forEach>
				<%---------------------------------end:  绑定查看中图js -------------------------%>
				
			});
			
			$j(window).load(function () {
				//start:flash实现剪贴板
				initClipboard();
				//end:flash实现剪贴板
			});
			
			
		</script>
		<!-- 分享好友 -->
		<script type="text/javascript" src="http://www.passit.cn/js/passit_default_new.js?pub=0&simple=0" charset="UTF-8"></script>
	</body>
</html>